/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client.network;
import java.io.*;
import java.net.*;
/**
 *
 * @author DUCMINHKHOI
 */
public class ClientTaskData {
    private static Integer portControl = 1999;
    private static Integer maxPeerService = 10;

        public  void run() {

          try {
                ServerSocket serverSocket = null;
                boolean listening = true;
                int count = 0;
                try {
                    serverSocket = new ServerSocket(portControl);
                } catch (IOException e) {
                    System.err.println("Could not listen on port: " + portControl);
                    System.exit(-1);
                }
                System.out.println("Server start control port!");
                while (listening){
                    new ReceiveTask(serverSocket.accept()).start();
                    count++;
                }
                serverSocket.close();
            } catch (IOException e){}

        }
}
